import 'package:json_annotation/json_annotation.dart';

part 'version.g.dart';

@JsonSerializable()
class Version extends Object {
  @JsonKey(name: 'appType')
  int appType;

  @JsonKey(name: 'ctime')
  String ctime;

  @JsonKey(name: 'deleted')
  int deleted;

  @JsonKey(name: 'forceUpdate')
  int forceUpdate;

  @JsonKey(name: 'id')
  int id;

  @JsonKey(name: 'packages')
  String packages;

  @JsonKey(name: 'redDotWarn')
  int redDotWarn;

  @JsonKey(name: 'status')
  int status;

  @JsonKey(name: 'storeIds')
  String storeIds;

  @JsonKey(name: 'updateScope')
  int updateScope;

  @JsonKey(name: 'updateTip')
  int updateTip;

  @JsonKey(name: 'utime')
  String utime;

  @JsonKey(name: 'version')
  String version;

  @JsonKey(name: 'versionExternal')
  String versionExternal;

  @JsonKey(name: 'versionInternal')
  String versionInternal;

  Version(
    this.appType,
    this.ctime,
    this.deleted,
    this.forceUpdate,
    this.id,
    this.packages,
    this.redDotWarn,
    this.status,
    this.storeIds,
    this.updateScope,
    this.updateTip,
    this.utime,
    this.version,
    this.versionExternal,
    this.versionInternal,
  );

  factory Version.fromJson(Map<String, dynamic> srcJson) => _$VersionFromJson(srcJson);

  Map<String, dynamic> toJson() => _$VersionToJson(this);
}
